//Model 2 of the 3D tutorial
 model TEST_DYNAMIC_MODEL

global
{
	int nb_cells <- 50;
	int environmentSize <- 100;
	geometry shape <- cube(environmentSize);
	init
	{
		create cells number: nb_cells
		{
			location <- { rnd(environmentSize), rnd(environmentSize), rnd(environmentSize) };
		}
	}
}

species cells skills: [moving3D]
{
	float radius <- environmentSize * 0.01;
	reflex move
	{
		do move;
	}

	aspect default
	{
		draw sphere(radius) color: # red;
	}

}

experiment DYNAMIC_MODEL type: gui
{
	output
	{
		display View1 type: java3d
		{
			graphics "env"
			{
				draw cube(environmentSize) color: # black empty: true;
			}

			species cells;
		}

	}

}